@echo off

setlocal enabledelayedexpansion

call ..\setEnv.bat

set info_m=
set /a ret=0

set NLS_LANG=AMERICAN_AMERICA.UTF8

if exist enable_triggers.log del enable_triggers.log
if exist exp_source.log del exp_source.log
if exist DROP_TYPE_NUMBER_ARRAY.log del DROP_TYPE_NUMBER_ARRAY.log

echo exec enable_triggers.sql ... ...
sqlplus %src_dbuser%/%src_dbpwd%@%src_tnsname% @enable_triggers.sql

echo errorlevel = !errorlevel!
IF NOT ERRORLEVEL 0 goto finish

echo exec exp_source.sql ... ...
sqlplus %src_dbuser%/%src_dbpwd%@%src_tnsname% @exp_source.sql

echo errorlevel = !errorlevel!
IF NOT ERRORLEVEL 0 goto finish

echo exec DROP_TYPE_NUMBER_ARRAY.sql ... ...
sqlplus %src_dbuser%/%src_dbpwd%@%src_tnsname% @DROP_TYPE_NUMBER_ARRAY.sql
echo errorlevel = !errorlevel!
IF NOT ERRORLEVEL 0 goto finish


:finish

IF NOT ERRORLEVEL 0 (
  set ret=-100
  set info_m=with errors.
) else (
  set ret=100
  set info_m=without errors.
)  

echo finish !info_m!
exit !ret!

endlocal